/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package de.recipeminer.mining;

import com.aliasi.spell.TfIdfDistance;
import com.aliasi.tokenizer.IndoEuropeanTokenizerFactory;
import com.aliasi.tokenizer.TokenizerFactory;

/**
 * Implementation of LingPipes TfIdfDisctance
 * @author Georg Mühlenberg
 */
public class TermFrequencyImpl {

    TfIdfDistance distance;

    public void TermFrequencyImpl()
    {
/*
 * do nothing
 */
    }

    /**
     * Creates a new TF/IDF-Distance and sets it.
     */
    public void initializeNewDistance( )
    {
        TokenizerFactory tokenizer = IndoEuropeanTokenizerFactory.INSTANCE;
        distance = new TfIdfDistance(tokenizer);
        this.setDistance(distance);
        
    }

    /**
     * Gives the distance pointer for serialisation purposes
     * @return TfIdfDistance distance
     */
    public TfIdfDistance getDistance()
    {
        return distance;
    }

        /**
     * Sets the distance pointer for deserialisation purposes
     * @return TfIdfDistance distance
     */
    public void setDistance(TfIdfDistance td)
    {
        this.distance = td;
    }

    public void trainWith(String s)
    {
      distance.handle(s);
    }




}
